local DAYS = 7
local MAX_PREM_DAYS = 210
local PREM_COST = 10000

function onSay(cid, words, param, channel)
	if getPlayerPremiumDays(cid) + DAYS <= MAX_PREM_DAYS then
		if getPlayerMoney(cid) >= PREM_COST then
			doPlayerRemoveMoney(cid, PREM_COST)
			doPlayerAddPremiumDays(cid, DAYS)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Seven premium days were added.")
		else
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You did not afford to purchase premium time. (" .. PREM_COST .. " gp)")
		end
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have enough premium time already.")
	end
	return false
end

local function getPlayerMoney(cid)
	return ((getPlayerItemCount(cid, 2160) * 10000) +
	(getPlayerItemCount(cid, 2152) * 100) +
	getPlayerItemCount(cid, 2148))
end
